package com.mohe.shanpao.domain.crawler;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;

@Table(name = "crawl_rule")
public class CrawlRule 
{
	@Id
	@Column(name = "id")
	private long id;
	
	@Column(name = "item")
	private String item;
	
	@Column(name = "name")
	private String name;
	
	@Column(name = "url_regex")
	private String urlRegex;
	
	@Column(name = "page_rule")
	private String pageRule;
	
	@Column(name = "next_rule")
	private String nextRule;
	
	@Column(name = "post_url")
	private String postUrl;
	
	@Column(name = "create_time")
	private Date createTime;
	
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		if(createTime == null)
		{
			createTime = new Date();
		}
		
		this.createTime = createTime;
	}
	public String getPostUrl() {
		return postUrl;
	}
	public void setPostUrl(String postUrl) {
		this.postUrl = postUrl;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getItem() {
		return item;
	}
	public void setItem(String item) {
		this.item = item;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrlRegex() {
		if(urlRegex == null)
		{
			urlRegex = "";
		}
		
		return urlRegex;
	}
	public void setUrlRegex(String urlRegex) {
		if(urlRegex == null)
		{
			urlRegex = "";
		}
		
		this.urlRegex = urlRegex;
	}
	public String getNextRule() {
		if(nextRule == null)
		{
			nextRule = "";
		}
		
		return nextRule;
	}
	public void setNextRule(String nextRule) {
		if(nextRule == null)
		{
			nextRule = "";
		}
		
		this.nextRule = nextRule;
	}
	
	public String getPageRule() {
		if(pageRule == null)
		{
			pageRule = "";
		}
		
		return pageRule;
	}
	public void setPageRule(String pageRule) {
		if(pageRule == null)
		{
			pageRule = "";
		}
		
		this.pageRule = pageRule;
	}
	
}
